/*
 * Amendment History:
 * 
 * Date       By         Description 
 * ----------------------------------------------- 
 * Feb 1, 2010 Anselm Hou    Create the class
 */
package com.inibb.app.util.ioc.i18n;

import java.util.Set;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.Assert;

public class MessageSourceAdapter implements InitializingBean
{
	public void afterPropertiesSet() throws Exception
	{
		Assert.notNull(messageSource,"Miss-configuration: messageSource is not set");
		Assert.notEmpty(getMessageBundleList());
		getMessageSource().addMessageBundles(getMessageBundleList());
	}

	private Set<String> messageBundleList;
	
	private ExtendedMessageSource messageSource;

	public Set<String> getMessageBundleList()
	{
		return messageBundleList;
	}

	public void setMessageBundleList(Set<String> messageBundleList)
	{
		this.messageBundleList = messageBundleList;
	}

	public ExtendedMessageSource getMessageSource()
	{
		return messageSource;
	}

	public void setMessageSource(ExtendedMessageSource messageSource)
	{
		this.messageSource = messageSource;
	}

}
